# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=bintrees
pkgname=python-bintrees
pkgver=2.2.0
pkgrel=2
pkgdesc='Package provides Binary-, RedBlack- and AVL-Trees'
url='https://github.com/mozman/bintrees'
arch=('loong64' 'x86_64')
license=('custom')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools' 'cython')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('640b9979ff9ef25fedbc59c9203363039e732b1ecbeda6475126c7c872207e9b790b7c6c8e67457c029f0d5397c28e6767c1c49061693135206eece98bb203bf')
b2sums=('4a4dce2529a0eb3ac2c9d34e2170e58517f87d82590cf910903e25dbb0c97e2d8b67c4fe46ac3ab664d46769e222095d2baf26fcf04925796384d71681fe80f5')

build() {
  cd "${_pyname}-${pkgver}"
  python setup.py build_ext -i
  python -m build --wheel --no-isolation
}

check() {
  cd "${_pyname}-${pkgver}"
  python -m unittest discover
}

package() {
  cd "${_pyname}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
